test: add check crop box padding to save_elements test #4123
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Updated
save_elementstest to check the behavior of the environment variablesEXTRACT_IMAGE_BLOCK_CROP_HORIZONTAL_PADandEXTRACT_IMAGE_BLOCK_CROP_VERTICAL_PADthat pad the crop box for image extraction.Note
Enhances save_elements tests to validate crop-box padding via env vars and image dimensions for both payload and file outputs; bumps version and updates changelog.
test_save_elementsnow parametrizeshorizontal_padding/vertical_padding, setsEXTRACT_IMAGE_BLOCK_CROP_HORIZONTAL_PADandEXTRACT_IMAGE_BLOCK_CROP_VERTICAL_PAD, and asserts padded image dimensions for bothextract_image_block_to_payloadpaths (decodingimage_base64or reading saved file).base64,io).unstructured/__version__.pyto0.18.21-dev0.Written by Cursor Bugbot for commit a23bf6a. This will update automatically on new commits. Configure here.